﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GiveAQuiz.Common;

namespace GiveAQuiz.Data
{

  public partial class QuestionDefinition
  {
    public string GetAnswerResult(string resultData)
    {
      return Question.GetAnswerText(resultData);
    }

    // Refection Created Question Object
    // Originally defined on the Client-side
    IQuestionType _questionType = null;

    internal IQuestionType Question
    {
      get
      {
        if (_questionType == null)
        {
          Type t = System.Type.GetType(this.QuestionTypeName, true);
          object type = Activator.CreateInstance(t);
          _questionType = type as IQuestionType;
        }

        return _questionType;
      }
    }
  }

  public partial class QuestionType
  {
  }
}
